Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix StackOverflowError on resolving types with TypeVariable recursion #1128

Merged
merged 2 commits into from
Jul 31, 2017

Conversation

amogilev
Copy link
Contributor

Sample failing code:
private static class TestType {
TestType<? super X> superType;
}
...
new Gson().getAdapter(TestType.class);

amogilev added 2 commits July 31, 2017 23:51
Sample failing code:
  private static class TestType<X> {
    TestType<? super X> superType;
  }
  ...
  new Gson().getAdapter(TestType.class);
@inder123 inder123 self-assigned this Jul 31, 2017
@inder123
Copy link
Collaborator

👍

@inder123 inder123 merged commit 03a72e7 into google:master Jul 31, 2017
@inder123
Copy link
Collaborator

Thank you for a test that demonstrates the problem!

@amogilev amogilev deleted the fix-typevar-resolve-recursion branch July 31, 2017 17:52
@eamonnmcmanus eamonnmcmanus mentioned this pull request Sep 11, 2017
sebasjm pushed a commit to sebasjm/gson that referenced this pull request Mar 11, 2018
…google#1128)

* Fix StackOverflowError on resolving types with TypeVariable recursion

Sample failing code:
  private static class TestType<X> {
    TestType<? super X> superType;
  }
  ...
  new Gson().getAdapter(TestType.class);

* fix build errors
ZacSweers added a commit to square/moshi that referenced this pull request Oct 13, 2019
ZacSweers added a commit to square/moshi that referenced this pull request Oct 15, 2019
* Port Gson Types recursion fix for subtypeOf/supertypeOf

From google/gson@a300148

First step in resolving #338

* Port Gson Type resolve() recursion fix for type variables

From google/gson#1128

Resolves #338

* Capture adapter to make checkstyle happy

* Move RecursiveTypesResolveTest out of internal package

* Use moshi convention for tests

* 2 is not 1
murillorodney62 added a commit to murillorodney62/kotlin-codegen-android that referenced this pull request Oct 12, 2022
* Port Gson Types recursion fix for subtypeOf/supertypeOf

From google/gson@a300148

First step in resolving #338

* Port Gson Type resolve() recursion fix for type variables

From google/gson#1128

Resolves #338

* Capture adapter to make checkstyle happy

* Move RecursiveTypesResolveTest out of internal package

* Use moshi convention for tests

* 2 is not 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants